//
//  HuaDaoPeifuTests.swift
//  HuaDaoPeifuTests
//
//  Created by 刘杰 on 2018/7/20.
//  Copyright © 2018年 paiyipai. All rights reserved.
//

import XCTest
@testable import HuaDaoPeifu


class HuaDaoPeifuTests: XCTestCase {
    
    override func setUp() {
        super.setUp()
        // Put setup code here. This method is called before the invocation of each test method in the class.
        /*
         申请赔付流程：
            1. 初始化案件，获取到case_id  requestInitCase
            2. 进入申请第一页，获取默认被保人  requestDefaultRecognizee  result.data
                * 如果 status == 1 ，则去选择被保人
                * 如果 status == 2 ，则使用返回的默认被保人
            3. 进入申请第二页，关联被保人和案件 参数:case_id & 被保人info_id  infoAddPartone
            4. 获取以保存的保单内容 requestParttwo
            5. 提交parttwo表单 updateParttwo
            6. 来到第三个表单：获取图片地址
         */
//        var case_id = ""
//        // 1.
//        HDApiManagerHandler.requestInitCase("000000199800001") { (result:HDCaseModel?) in
//            case_id = (result?.case_id)!
//
//            HDApiManagerHandler.requestDefaultRecognizee("", case_id) { (result2:HDApiResult?) in
//
//                if result2?.data?.status == "1"{
//                    // 去选择被保人
//                }
//                else if result2?.data?.status == "2"{
//                    // 关联 case_id 和 info_id
//                    HDApiManagerHandler.infoAddPartone(case_id, (result2?.data?.id)!, {
//                        (result3) in
//                        // print(result3?.data)
//                    })
//
//                    // 获取parttwo
//                    HDApiManagerHandler.requestParttwo(case_id, (result2?.data?.id)!, { (result4) in
//                        print(result4)
//                    })
//                }
//
//            }
//        }

//        HDApiManagerHandler.requestArchivesImages("79782", "000000199800001") { (result:[String:Any]?) in
//            print(result)
//        }

//        HDApiManagerHandler.requestPolicyBillList(caseID: "79755") { (payModels, nopayModels) in
//
//
//            let html = HDHtmlHelper.policyBillTableHtml(payModels!, nopayModels!)
//            print(html.payHtml)
//            print(html.nopayHtml)
//        }
        
        HDApiManagerHandler.closeCase("79849") { (result) in
            print(result)
        }

    }
    
    override func tearDown() {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
        super.tearDown()
    }
    
    func testExample() {
        // This is an example of a functional test case.
        // Use XCTAssert and related functions to verify your tests produce the correct results.
    }
    
    func testPerformanceExample() {
        // This is an example of a performance test case.
        self.measure {
            // Put the code you want to measure the time of here.
        }
    }
    
}
